// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';

/**
 * 门店管理
 */
import Home from "@/views/home/Home";
import clerk from "@/views/store/clerk";
import goods from "@/views/store/goods";
import order from "@/views/store/order";
import purchase from "@/views/store/purchase";
import stockRecord from "@/views/store/stockRecord";

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
          {
            path: '/home/homePage',
            name: '首页',
            component: Home,
            meta: {
              requireAuth: true
            }
          }, {
            path: '/store/clerk',
            name: '店员管理',
            component: clerk,
            meta: {
              requireAuth: true
            }
          }, {
            path: '/store/goods',
            name: '商品管理',
            component: goods,
            meta: {
              requireAuth: true
            }
          },{
            path: '/store/order',
            name: '订单管理',
            component: order,
            meta: {
              requireAuth: true
            }
          },{
            path: '/store/purchase',
            name: '采购管理',
            component: purchase,
            meta: {
              requireAuth: true
            }
          },{
            path: '/store/stockRecord',
            name: '库存记录',
            component: stockRecord,
            meta: {
              requireAuth: true
            }
          },
          ]
    }]
})
